//
//  ExhibitionCell.m
//  PASystem
//
//  Created by 刘沿 on 16/8/22.
//  Copyright © 2016年 czd. All rights reserved.
//

#import "ExhibitionCell.h"

@implementation ExhibitionCell

+ (instancetype)WithExhibitionCell{

    return [[[NSBundle mainBundle] loadNibNamed:@"ExhibitionCell" owner:nil options:nil] lastObject];
}

- (void)setModel:(ExhibitionModel *)model{

    _model = model;

    self.NAME.text = model.NAME;
    
    self.ADDRESS.text = model.ADDRESS;
    
    //时间戳转时间
    NSString *string = model.BEGINDATE;
    NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
    fmt.dateFormat = @"MMM d, yyyy HH:mm:ss aa";
    fmt.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en-US"];
    NSDate *date = [fmt dateFromString:string];
    NSDateFormatter *fm = [[NSDateFormatter alloc] init];
    fm.dateFormat = @"yyyy-MM-dd";
    NSString *selfYear = [fm stringFromDate:date];
    
    self.BEGINDATE.text = selfYear;
    
    if ([model.TYPE isEqualToString:@"0"]) {
        
        self.TYPE.text = @"为送审";
        
    }else if ([model.TYPE isEqualToString:@"1"]){
        self.TYPE.text = @"待审核";

    
    }else if ([model.TYPE isEqualToString:@"2"]){
        self.TYPE.text = @"审核通过";

        
    }else{
        self.TYPE.text = @"审核未通过";
    }
    

}




@end
